///////////////////////////////////////////////////////////////////////////////
//-----------------------------------------------------------------------------
#include <Config.h>
#include <AbstractManager.h>
#include <vector>
//-----------------------------------------------------------------------------

class	GarbageCollector	:	AbstractManager<GarbageCollector>
{
public:
	GarbageCollector();
	~GarbageCollector();

	void	SetAutomaticCollection(bool enable)	{	m_autoCollect = enable;	}
	void	SetAutomaticCollectionLimit(u32 limit);
	u32		GetAutomaticCollectionLimit()		{	return m_autoCollectLimit;	}

	void	collectGarbage(void* ptr, bool releaseNow = false);
	void	takeOutTrash();
private:

	bool				m_autoCollect;
	u32					m_autoCollectLimit;
	std::vector<void*>	m_garbage;
};

//-----------------------------------------------------------------------------
///////////////////////////////////////////////////////////////////////////////
